package main.java.controller;


import main.java.pojo.Brand;
import main.java.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Collection;

@Controller
public class BrandController {

    @Autowired
    private BrandService brandService;

    @RequestMapping("/tobrand")
    public String togrand(Model model){
        Collection<Brand> brands=brandService.queryBrand();
        model.addAttribute("brands",brands);
        return "brand_list";
    }
}
